import { Modal } from 'antd'
import PropTypes from 'prop-types'

const CommonModal = ({
  children,
  header,
  ...props
}) => {
  return <Modal
    maskClosable={false}
    keyboard={false}
    centered
    {...props}
  >
    {
      header
    }
    <div style={{
      maxHeight: 'calc(100vh - 200px)',
      overflow: 'auto'
    }}>
      {children}
    </div>
  </Modal>
}

CommonModal.propTypes = {
  header: PropTypes.node
}

export default CommonModal